<?php
$this->lang->load('template');
//$this->lang->load('validation');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0048)http://www.fav365.com/ball/?m=admin&c=good&a=add -->
<HTML>
<HEAD>
<TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK 
href="/css/admin.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.3395" name=GENERATOR>
<STYLE type=text/css>
.STYLE1 {
	COLOR: #ff0000
}
</STYLE>
</HEAD>
<BODY>
<DIV class=admin_box>
  <DIV class=admin_boxtop></DIV>
  <DIV class=admin_boxmain>
 	<?=form_open_multipart('categories/save');?>
    <input type="hidden" value="<?=intval($result['id'])?>" name="id" />
    <input type="hidden" value="<?=site_url('categories/admin')?>" name="redirect" />
    <TABLE cellSpacing=0 cellPadding=0 width="96%" align=center border=0>
      <TBODY>
        <TR>
          <TD><H1 class=title>
              <?php if(!isset($result)):?>
              <?=$this->lang->line('tpl_act_add')?><?=$this->lang->line('tpl_cates');?>
              <?php else:?>
              <?=$this->lang->line('tpl_act_edit')?><?=$this->lang->line('tpl_cates');?>-
              <?=$result['name']?>
              <?php endif;?>
            </H1></TD>
        </TR>
      </TBODY>
    </TABLE>
    <div>
      <?=$this->validation->error_string; ?>
    </div>
    <TABLE class=table cellSpacing=1 cellPadding=5 width="96%" align=center border=0>
      <TBODY>
        <TR>
          <TD class="tdbg bold" width="24%"><DIV align=right><?=$this->lang->line('tpl_cates');?><?=$this->lang->line('tpl_name');?></DIV></TD>
          <TD><INPUT class=inputstyle name="name" value="<?=$result['name']?>">
            <SPAN class=STYLE1>*</SPAN></TD>
        </TR>
        <TR>
          <TD class="tdbg bold"><DIV align=right><?=$this->lang->line('tpl_upcates');?></DIV></TD>
          <TD><SELECT class=inputstyle name="parent_id">
              <option value="0"><?=$this->lang->line('tpl_plsselect');?></option>
              <?php
		$select = '';
        foreach ($options AS $var)
        {
            $select .= '<option value="' . $var['id'] . '" ';
            $select .= ($var['id'] == $result['parent_id']) ? "selected='ture'" : '';
			if($var['cat_type']==1) $select .= ' disabled="disabled"';
            $select .= '>';
            if ($var['level'] > 0)
            {
                $select .= str_repeat('&nbsp;', $var['level'] * 4);
            }
            $select .= htmlspecialchars($var['name'], ENT_QUOTES) . '</option>';
        }
		echo $select;
		?>
            </SELECT>
            <SPAN class=STYLE1>*</SPAN> </TD>
        </TR>
        <TR>
          <TD class="tdbg bold"><DIV align=right><?=$this->lang->line('tpl_system').$this->lang->line('tpl_cates');?></DIV></TD>
          <TD><select name="cat_type" onChange="catChanged()">
              <option cat_type="2" value="2"<?php if($result['cat_type']==2):?> selected="selected"<?php endif;?>><?=$this->lang->line('tpl_article_type_normal');?><?=$this->lang->line('tpl_cates');?></option>
              <option value="1"<?php if($result['cat_type']==1):?> selected="selected"<?php endif;?>>
			  <?=$this->lang->line('tpl_system').$this->lang->line('tpl_cates');?></option>
            </select>
          </TD>
        </TR>
        <TR>
          <TD class="tdbg bold"><DIV align=right><?=$this->lang->line('tpl_yes')?><?=$this->lang->line('tpl_no')?><?=$this->lang->line('tpl_ishow')?></DIV></TD>
          <TD><select name="is_show">
              <option value="1"<?php if($result['is_show']==1):?> selected="selected"<?php endif;?>><?=$this->lang->line('tpl_yes')?></option>
              <option value="0"<?php if(isset($result['is_show'])&&$result['is_show']==0):?> selected="selected"<?php endif;?>><?=$this->lang->line('tpl_no')?></option>
            </select></TD>
        </TR>
        <?php 
	/*<TR>
    <TD class="tdbg bold">
      <DIV align=right><?=$this->lang->line('tpl_yes')?><?=$this->lang->line('tpl_no')?>导航<?=$this->lang->line('tpl_ishow')?></DIV></TD>
    <TD>
   <select name="show_in_nav">
		<option value="1"<?php if($result['show_in_nav']==1):?> selected="selected"<?php endif;?>><?=$this->lang->line('tpl_yes')?></option>
		<option value="0"<?php if($result['show_in_nav']==0):?> selected="selected"<?php endif;?>><?=$this->lang->line('tpl_no')?></option>
	</select>
    </TD></TR>*/
    ?>
        <TR>
          <TD class="tdbg bold"><DIV align=right><?=$this->lang->line('tpl_sort')?></DIV></TD>
          <TD><input type="text" name="sort_order" value="<?=intval($result['sort_order'])?>">（0->1->2） </TD>
        </TR>
        <TR>
          <TR>
          <TD class="tdbg bold"><DIV align=right>image:</DIV></TD>
          <TD><input type="file" name="userfile" value=""> </TD>
        </TR>
        <TR>
          <TD class="tdbg bold" width="24%"><DIV align=right><?=$this->lang->line('tpl_keyword');?></DIV></TD>
          <TD><INPUT class=inputstyle name="keywords" value="<?=$result['keywords']?>"></TD>
        </TR>
        <?php if($_GET['type']=='good'):?>
        <TR>
          <TD class="tdbg bold" width="24%"><DIV align=right>图片</DIV></TD>
          <TD><INPUT type="file" class=inputstyle name="file" ></TD>
        </TR>
        <?php endif;?>
        <TR>
          <TD class="tdbg bold" width="24%"><DIV align=right><?=$this->lang->line('tpl_template');?></DIV></TD>
          <TD><INPUT class=inputstyle name="tpls" value="<?=$result['tpls']?>">
          </TD>
        </TR>
        <TR>
          <TD class="tdbg bold"><DIV align=right><?=$this->lang->line('tpl_desc')?></DIV></TD>
          <TD><TEXTAREA class=inputstyle name=cat_desc rows=5><?=$result['cat_desc']?>
</TEXTAREA>
            <SPAN 
      class=STYLE1>*</SPAN></TD>
        </TR>
        <TR>
          <TD colSpan=2><DIV align=center>
              <INPUT class=btn type=submit value="<?=$this->lang->line('tpl_submit');?>" name=Submit>
              <INPUT class=btn onclick=history.back(-1) type=button value="<?=$this->lang->line('tpl_returnback');?>">
            </DIV></TD>
        </TR>
      </TBODY>
    </TABLE>
    </FORM>
  </DIV>
  <DIV class=admin_boxbottom></DIV>
</DIV>
</BODY>
</HTML>
